<?php
require_once "../class/Base.class.php";
require_once "../class/WxPay.class.php";
require_once "../class/Price.class.php";


$price=new Price();
$test=new WxPay();
//echo dirname(getcwd()).'/pay/cert/';
//获取公钥
//$res=$test->getPuykey();
//echo '<pre/>';
//var_dump($res);
//die;
//读取新的公钥
$pubkey=file_get_contents(dirname(getcwd()).'/pay/cert/newpubkey.pem');
//加密方法
//$rsa=new RSA($pubkey,'');
//微信通过金额计算
$prices=$price->price_conversion(1);

//银行卡号:6212260200062142365     6217002460022978629
$data=array(
    'partner_trade_no'    => date('YmdHis').rand(1000,9999),   //订单号
    'enc_bank_no'         => $test->publicEncrypt('xxxxxx',$pubkey),//收款方银行卡号RSA加密
    'enc_true_name'       => $test->publicEncrypt('xxxx',$pubkey),//收款方姓名RSA加密
    'bank_code'           => '1003',//收款方开户行 银行编号
    'amount'              => $prices,//付款金额 默认是分，最少1元
);



//往银行卡打钱
$pay_info=$test->bankPay($data);
echo '<pre/>';
var_dump($pay_info);

